//
//  OPPrivateMsg.h
//  OPFramework
//
//  Created by malcom on 7/24/08.
//  Copyright 2008 malcom-mac software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "OPUser.h"
#import "OPBaseObject.h"
#import "OPAuthUser.h"

// - (BOOL) replyWithMessage:(NSString *) _message withOptions:(NSDictionary *) _options;
//	_options dictionary elements
#define OPPrivateMsg_Options_EnableSign		@"enable_signature"
#define OPPrivateMsg_Options_EnableSmiles	@"enable_smiles"
#define OPPrivateMsg_Options_EnableBBCode	@"enable_bbcode"
#define OPPrivateMsg_Options_EnableURLs		@"enable_urls"
#define OPPrivateMsg_Options_PutInOutbox	@"put_in_outbox"

@interface OPPrivateMsg : OPBaseObject {
	NSNumber		*p_msgID;		// private message id
	OPUser			*p_author;		// private message author
	NSDate			*p_sendDate;	// send date
	NSString		*p_subject;		// message's subject
	NSString		*p_text;		// message's text
	
	// INTERNAL USE
	NSNumber		*_folderID;
}

@property (readonly) 	NSNumber		*p_msgID;
@property (readonly)	OPUser			*p_author;
@property (readonly)	NSDate			*p_sendDate;
@property (readonly)	NSString		*p_subject;
@property (readonly)	NSString		*p_text;

#pragma mark PUBLIC METHODS
- (BOOL) markAsRead;
- (BOOL) replyWithMessage:(NSString *) _message withOptions:(NSDictionary *) _options;

#pragma mark PRIVATE METHODS
- (id) _initLoadingDataResponse:(NSDictionary *) _data forBoard:(OPBoard *) _board;
+ (BOOL) _sendMessageWithMode:(NSString *) _mode toUser:(NSNumber *) _userid withSubject:(NSString *) _subj text:(NSString *) _text replyTo:(NSNumber *) _msgid options:(NSDictionary *) _options board:(OPBoard *) _board;
@end
